package top.infopub.model.mkt;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.StringUtils;
import org.springframework.format.annotation.DateTimeFormat;
import top.infopub.enums.mkt.ProProcessDetailTypeEnum;
import top.infopub.enums.mkt.ProjectRiskLevelEnum;
import top.infopub.enums.mkt.ProjectRiskSolveWayEnum;
import top.infopub.generic.GenericEntity;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 项目风险
 * */
public class ProjectRisk extends GenericEntity {
    private static final long serialVersionUID = 1L;

    /*PK*/
    private String id;
    /*PK*/
    public String getId(){
        return id;
    }

    public void setId(String id){
        this.id = id;
    }

    /* 添加人 */
    private String addBy;

    /*销项人*/
    private  String sellName;

    public String getAddBy(){
        return addBy;
    }

    public void setAddBy(String addBy){
        this.addBy = addBy;
    }
    /* 添加时间 */
    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date addTime;

    public Date getAddTime(){
        return addTime;
    }

    public void setAddTime(Date addTime){
        this.addTime = addTime;
    }
    /* 项目全局唯一编号 */
    private String proCode;

    public String getProCode(){
        return proCode;
    }

    public void setProCode(String proCode){
        this.proCode = proCode;
    }

    /**
     * 风险描述
     * */
    private String riskDesc;

    /**
     * 风险等级
     * */
    private String riskLevel;
    /**
     * 风险处理策略
     * */
    private String solveWay;

    /**
     * 状态
     * */
    private String status;
//最新进展
    private String  latestProgress;

    /*跟踪人员*/
    private String staffName;


    //风险来源
    private String riskStage;

    private String riskStageName;


    //标识
    private String isStatus;

    public String getIsStatus() {
        return isStatus;
    }

    public void setIsStatus(String isStatus) {
        this.isStatus = isStatus;
    }

    //项目风险等级
    private List<Map<String, String>> riskLevels = ProjectRiskLevelEnum.asList();

    //项目风险处理策略
    private List<Map<String, String>> riskSolveWays = ProjectRiskSolveWayEnum.asList();

    public String getRiskStage() {
        return riskStage;
    }

    public void setRiskStage(String riskStage) {
        this.riskStage = riskStage;
        if (StringUtils.isNotBlank(riskStage)) {
            ProProcessDetailTypeEnum ppdt = ProProcessDetailTypeEnum.getByNode(riskStage);
            if (ppdt != null) {
                setRiskStageName(ppdt.getNodeName());
            }
        }
    }


    public String getLatestProgress() {
        return latestProgress;
    }

    public void setLatestProgress(String latestProgress) {
        this.latestProgress = latestProgress;
    }

    public String getRiskDesc() {
        return riskDesc;
    }

    public void setRiskDesc(String riskDesc) {
        this.riskDesc = riskDesc;
    }

    public String getRiskLevel() {
        return riskLevel;
    }

    public void setRiskLevel(String riskLevel) {
        this.riskLevel = riskLevel;
    }

    public String getSolveWay() {
        return solveWay;
    }

    public void setSolveWay(String solveWay) {
        this.solveWay = solveWay;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }


    private String updateBy;

    /*销项时间*/
    @JsonFormat(pattern="yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date updateTime;

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    /*项目阶段*/
    private String proStage;

    public String getProStage() {
        return proStage;
    }

    public void setProStage(String proStage) {
        this.proStage = proStage;
    }


    public String getStaffName() {
        return staffName;
    }

    public void setStaffName(String staffName) {
        this.staffName = staffName;
    }

    public List<Map<String, String>> getRiskLevels() {
        return riskLevels;
    }

    public void setRiskLevels(List<Map<String, String>> riskLevels) {
        this.riskLevels = riskLevels;
    }

    public List<Map<String, String>> getRiskSolveWays() {
        return riskSolveWays;
    }

    public void setRiskSolveWays(List<Map<String, String>> riskSolveWays) {
        this.riskSolveWays = riskSolveWays;
    }

    public String getRiskStageName() {
        return riskStageName;
    }

    public void setRiskStageName(String riskStageName) {
        this.riskStageName = riskStageName;
    }

    public String getSellName() {
        return sellName;
    }

    public void setSellName(String sellName) {
        this.sellName = sellName;
    }
}
